<!DOCTYPE html>
<html lang="en"><head>
    <meta charset="UTF-8">
    <title>uibuilder Technical Documentation v3</title>

    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="description" content="uibuilder Technical Documentation">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="icon" type="image/png" href="./favicon.ico">

    <!-- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsify@latest/themes/vue.css" /> -->
    <!-- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsify-darklight-theme@latest/dist/style.min.css"
        title="docsify-darklight-theme" type="text/css" /> -->
    <!-- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsify-themeable@latest/dist/css/theme-simple.css"> -->

    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsify-darklight-theme@latest/dist/docsify-themeable/style.min.css" type="text/css">
    <!-- docsify-themeable styles-->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsify-themeable@latest/dist/css/theme-simple.css" title="light">
    <link rel="stylesheet alternative" href="https://cdn.jsdelivr.net/npm/docsify-themeable@latest/dist/css/theme-simple-dark.css" title="dark">
    <style>
        :root {
            --base-font-size: 20px;
            --sidebar-width: 22em;
            /* --base-font-family: Frutiger W01, Arial, Sans-serif; */
            /*--sidebar-background: #005EB8;*/
        }
        .dhide {
            display: none;
        }

        img[src*="#cool"] {
            display: none;
        }
    </style>
</head><body>
    <div id="app">Loading, please wait ...</div>
    <script src="https://unpkg.com/docsify-edit-on-github/index.js"></script>
    <script>
        // https://docsify.js.org/
        // https://jhildenbiddle.github.io/docsify-themeable
        window.$docsify = {
            name: 'uibuilder Technical Documentation v3',
            repo: 'TotallyInformation/node-red-contrib-uibuilder',
            homepage: 'README.md',

            executeScript: true,
            // loadNavbar: true,
            // mergeNavbar: true,
            loadSidebar: true,
            autoHeader: false,
            logo: '/node-blue-192x192.png',
            auto2top: true,
            alias: {
                '/.*/_sidebar.md': '/_sidebar.md', // use the same sidebar everywhere. See #301
                '.*?/changelog': 'https://raw.githubusercontent.com/TotallyInformation/node-red-contrib-uibuilder/main/CHANGELOG.md',
                '.*?/uibhome': 'https://raw.githubusercontent.com/TotallyInformation/node-red-contrib-uibuilder/main/README.md',
                '/docs/(.*)': '/$1',
            },
            subMaxLevel: 2,
            search: {
                depth      : 3,
                noData     : 'No results!',
                placeholder: 'Search...'
            },
            pagination: {
                // previousText: '上一章节',
                // nextText: '下一章节',
                crossChapter: true,
                crossChapterText: true,
            },

            plugins: [
                EditOnGithubPlugin.create('https://github.com/TotallyInformation/node-red-contrib-uibuilder/blob/main/docs/'),
                // Custom plugin
                function (hook, vm) {
                    //console.log({hook,vm})

                    const orgName = 'Julian Knight (Totally Information)'
                    const orgUrl = 'https://it.knightnet.org.uk'

                    const footer = [
                        '<hr/>',
                        '<footer>',
                        '<span>',
                        'Copyright &copy; 2021', // per-page - (c) and date
                        ` <a href="${orgUrl}">${orgName}</a>.`,
                        '', // updated date
                        '</span> ',
                        '',
                        ' <span>Published with <a href="https://docsify.js.org/" target="_blank">docsify</a>.</span> ',
                        '</footer>'
                    ]

                    // Runs against the raw markdown for each page
                    hook.beforeEach(function(content) {
                        let strYr = (new Date()).getFullYear()
                        let mydate = false
                        let yearFrom = 2017
                        let yearTo = strYr
                        footer[5] = ''

                        if ( vm.frontmatter ) { // fm only exists per page, requires plugin
                            //#region --- Add front-matter (YAML) standard metadata to each page if present ---
                            if ( vm.frontmatter.description ) {
                                content = `${vm.frontmatter.description}\n\n${content}`
                            }

                            if ( vm.frontmatter.title ) {
                                content = `# ${vm.frontmatter.title}\n\n${content}`
                            }
                            //#endregion ---  ---

                            //#region --- Add page specific (c) and last updated date to each page if available from YAML front-matter ---
                            if ( vm.frontmatter.created ) {
                                mydate = new Date(vm.frontmatter.created)
                                yearFrom = mydate.getFullYear()
                            }

                            if ( vm.frontmatter.lastUpdated ) {
                                mydate = new Date(vm.frontmatter.lastUpdated)
                                yearTo = mydate.getFullYear()
                            }

                            if ( mydate !== false ) {
                                if ( yearFrom === yearTo && yearFrom !== Number(strYr) ) {
                                    strYr = yearFrom
                                } else if ( yearFrom !== yearTo ) {
                                    strYr = yearFrom + '-' + yearTo
                                }

                                footer[5] = ` Last updated ${mydate.toLocaleString('en-GB', { dateStyle: 'medium', timeStyle: 'short' })}.`
                            }
                            //#endregion ---  ---

                        } // ---- End of if front-matter ---- //

                        footer[3] = `Copyright &copy; ${strYr}`

                        return content

                    }) // ------- End of Custom Plugin ------- //

                    // Runs against the rendered HTML for each page
                    hook.afterEach(function (html, next) {
                        next( html + footer.join('') )
                    })
                },
            ],
        }
    </script>
    <script src="https://cdn.jsdelivr.net/npm/docsify@latest"></script>
    <script src="https://cdn.jsdelivr.net/npm/docsify@latest/lib/plugins/search.min.js"></script>
    <!-- <script src="https://cdn.jsdelivr.net/npm/docsify-darklight-theme@latest/dist/index.min.js" type="text/javascript"></script> -->
    <script src="https://cdn.jsdelivr.net/npm/docsify-darklight-theme@latest/dist/docsify-themeable/main.min.js" type="text/javascript"></script>
    <script src="https://cdn.jsdelivr.net/npm/docsify-darklight-theme@latest/dist/docsify-themeable/index.min.js" type="text/javascript"></script>
    <script src="https://cdn.jsdelivr.net/npm/prismjs@latest/components/prism-json.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/docsify@latest/lib/plugins/front-matter.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/docsify-mustache"></script> <!-- https://ppipada.github.io/post/markdown/2020-04-29-docsify-mustache/ -->
    <script src="https://unpkg.com/docsify-pagination/dist/docsify-pagination.min.js"></script>
    <!--<script src="//cdn.jsdelivr.net/npm/vue@2/dist/vue.min.js"></script>-->
</body></html>